#ifndef VECTOR4_H
#define VECTOR4_H

#include "Vector3.h"

namespace Cvekas {

/// 4D Vector
struct Vector4 : public D3DXVECTOR4 {
public:
   Vector4();
   Vector4(const float* f);
   Vector4(const D3DXFLOAT16* f);
   Vector4(float x, float y, float z, float w);
   Vector4(const D3DXVECTOR4& v);
   Vector4(const Vector3& v); // w = 1

    operator D3DXVECTOR4&();
    operator const D3DXVECTOR4&() const;

   void set(float vx, float vy, float vz, float vw);
};


inline Vector4::Vector4() 
	: 
D3DXVECTOR4() 
{}

inline Vector4::Vector4(const float *f) 
	: 
D3DXVECTOR4(f) 
{}

inline Vector4::Vector4(const D3DXFLOAT16 *f) 
	: 
D3DXVECTOR4(f) {}

inline Vector4::Vector4(float vx, float vy, float vz, float vw) 
	: 
D3DXVECTOR4(vx, vy, vz, vw) 
{}

inline Vector4::Vector4(const D3DXVECTOR4& v) 
	: 
D3DXVECTOR4(v) 
{}

inline Vector4::Vector4(const Vector3& v) 
	: 
D3DXVECTOR4(v.x, v.y, v.z, 1.0f) 
{}

inline void Vector4::set(float vx, float vy, float vz, float vw ) 
{ 
	x=vx; 
	y=vy; 
	z=vz; 
	w=vw; 
}

inline Vector4::operator D3DXVECTOR4&() 
{ 
	return *this; 
}

inline Vector4::operator const D3DXVECTOR4&() const 
{ 
	return *this; 
}

} // namespace

#endif
